package com.lims.landInfo.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javacommon.base.*;

/**
 * @author zzh
 * @version 1.0
 * @since 1.0
 */
@Entity
@Table(name = "LIMS_Corporation")
public class Corporation extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//columns START
    /**
     * objid       db_column: OBJID 
     */ 	
	private java.lang.String objid;
    /**
     * sno       db_column: SNO 
     */ 	
	private java.lang.Integer sno;
    /**
     * corpno       db_column: CORPNO 
     */ 	
	private java.lang.String corpno;
    /**
     * name       db_column: NAME 
     */ 	
	private java.lang.String name;
    /**
     * parentno       db_column: PARENTNO 
     */ 	
	private java.lang.String parentno;
    /**
     * changetype       db_column: CHANGETYPE 
     */ 	
	private java.lang.Integer changetype;
    /**
     * newparentcorpname       db_column: NEWPARENTCORPNAME 
     */ 	
	private java.lang.String newparentcorpname;
    /**
     * levelno       db_column: LEVELNO 
     */ 	
	private java.lang.Integer levelno;
    /**
     * oldparentno       db_column: OLDPARENTNO 
     */ 	
	private java.lang.String oldparentno;
    /**
     * oldparentname       db_column: OLDPARENTNAME 
     */ 	
	private java.lang.String oldparentname;
    /**
     * describe       db_column: DESCRIBE 
     */ 	
	private java.lang.String describe;
	//columns END


	public Corporation(){
	}

	public Corporation(
		java.lang.String objid
	){
		this.objid = objid;
	}

	

	public void setObjid(java.lang.String value) {
		this.objid = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid")//unique = true, 
	@Column(name = "OBJID", nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getObjid() {
		return this.objid;
	}
	
	@Column(name = "SNO", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public Integer getSno() {
		return this.sno;
	}
	
	public void setSno(Integer value) {
		this.sno = value;
	}
	
	@Column(name = "CORPNO", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getCorpno() {
		return this.corpno;
	}
	
	public void setCorpno(java.lang.String value) {
		this.corpno = value;
	}
	
	@Column(name = "NAME", unique = false, nullable = true, insertable = true, updatable = true, length = 150)
	public java.lang.String getName() {
		return this.name;
	}
	
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	@Column(name = "PARENTNO", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getParentno() {
		return this.parentno;
	}
	
	public void setParentno(java.lang.String value) {
		this.parentno = value;
	}
	
	@Column(name = "CHANGETYPE", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public Integer getChangetype() {
		return this.changetype;
	}
	
	public void setChangetype(Integer value) {
		this.changetype = value;
	}
	
	@Column(name = "NEWPARENTCORPNAME", unique = false, nullable = true, insertable = true, updatable = true, length = 150)
	public java.lang.String getNewparentcorpname() {
		return this.newparentcorpname;
	}
	
	public void setNewparentcorpname(java.lang.String value) {
		this.newparentcorpname = value;
	}
	
	@Column(name = "LEVELNO", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public java.lang.Integer getLevelno() {
		return this.levelno;
	}
	
	public void setLevelno(java.lang.Integer value) {
		this.levelno = value;
	}
	
	@Column(name = "OLDPARENTNO", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getOldparentno() {
		return this.oldparentno;
	}
	
	public void setOldparentno(java.lang.String value) {
		this.oldparentno = value;
	}
	
	@Column(name = "OLDPARENTNAME", unique = false, nullable = true, insertable = true, updatable = true, length = 150)
	public java.lang.String getOldparentname() {
		return this.oldparentname;
	}
	
	public void setOldparentname(java.lang.String value) {
		this.oldparentname = value;
	}
	
	@Column(name = "DESCRIBE", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	public java.lang.String getDescribe() {
		return this.describe;
	}
	
	public void setDescribe(java.lang.String value) {
		this.describe = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Objid",getObjid())
			.append("Sno",getSno())
			.append("Corpno",getCorpno())
			.append("Name",getName())
			.append("Parentno",getParentno())
			.append("Changetype",getChangetype())
			.append("Newparentcorpname",getNewparentcorpname())
			.append("Levelno",getLevelno())
			.append("Oldparentno",getOldparentno())
			.append("Oldparentname",getOldparentname())
			.append("Describe",getDescribe())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getObjid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Corporation == false) return false;
		if(this == obj) return true;
		Corporation other = (Corporation)obj;
		return new EqualsBuilder()
			.append(getObjid(),other.getObjid())
			.isEquals();
	}
}

